import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '反馈标题',
    align: 'center',
    dataIndex: 'feedbackTitle',
  },
  {
    title: '反馈内容',
    align: 'center',
    dataIndex: 'feedbackContent',
  },
  {
    title: '创建人',
    align: 'center',
    dataIndex: 'userId_dictText',
  },
  {
    title: '处理人',
    align: 'center',
    dataIndex: 'processor_dictText',
  },
  {
    title: '处理日期',
    align: 'center',
    dataIndex: 'processDatetime',
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '处理人',
    field: 'processor',
    component: 'JSearchSelect',
    componentProps: {
      dict: 'sys_user,realname,id',
    },
  },
  {
    label: '反馈标题',
    field: 'feedbackTitle',
    component: 'Input',
  },
  {
    label: '反馈内容',
    field: 'feedbackContent',
    component: 'Input',
  },
  {
    label: '创建人',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps: {
      dict: 'uf_mall_user,last_name,id',
    },
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '反馈标题',
    field: 'feedbackTitle',
    component: 'JInput',
  },
  {
    label: '反馈内容',
    field: 'feedbackContent',
    component: 'JInput',
  },
  {
    label: '创建人',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps: {
      dict: 'uf_mall_user,last_name,id',
    },
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  feedbackTitle: { title: '反馈标题', order: 1, view: 'text', type: 'string' },
  feedbackContent: { title: '反馈内容', order: 2, view: 'text', type: 'string' },
  processor: { title: '处理人', order: 3, view: 'text', type: 'string' },
  processDatetime: { title: '处理日期', order: 4, view: 'datetime', type: 'string' },
  userId: { title: '创建人', order: 5, view: 'text', type: 'string' },
};

/**
 * 流程表单调用这个方法获取formSchema
 * @param param
 */
export function getBpmFormSchema(_formData): FormSchema[] {
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
